<!--
功能：个人信息查询修改,
作者：RanSheng,
邮箱：1534677527@qq.com",
时间：2021/5/30 23:32,
版本：v1.0,
修改记录：,
修改内容：,
修改人员：,
修改时间：,
-->
<template>
  <div class="app">
    <div class="box-header">
      <el-image :src="headerUrl" class="image" fit="fill"></el-image>
      <div class="user-tou">
        <el-image :src="userUrl" fit="fill" class="image"></el-image>
      </div>
    </div>
    <div class="box-main">
      <div class="box-nave">
        <div class="page"
             v-for="p in nave"
             :key="p.id"
             :class="op4==p.id? 'bb':''"
             @click="$store.commit('setOp4',p.id)">
          <span><i :class="p.icon"></i></span>
          <span>{{ p.name }}</span>
        </div>
      </div>
      <div class="box-user">
        <transition mode="out-in" name="m">
          <keep-alive>
            <component name="keep" :is="MyList[op4-1]"></component>
          </keep-alive>
        </transition>
      </div>
    </div>
  </div>
</template>

<script>
import MyUser from "@/components/home/user/MyUser";
import MyCheck from "@/components/home/user/MyCheck";
import MyApply from "@/components/home/user/MyApply";
import MyCost from "@/components/home/user/MyCost";
import {mapState} from "vuex";

export default {
  name: "UserHome",
  data() {
    return {
      nave: [{
        id: 1,
        name: '个人信息',
        icon: 'el-icon-eleme'
      }, {
        id: 2,
        name: '个人考核',
        icon: 'el-icon-eleme'
      }, {
        id: 3,
        name: '个人申请',
        icon: 'el-icon-eleme'
      }, {
        id: 4,
        name: '个人缴费',
        icon: 'el-icon-eleme'
      }],
      MyList: ["MyUser", "MyCheck", "MyApply", "MyCost"],
      headerUrl: require('../../assets/imag/welcome19.jpg'),
      userUrl: 'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
    };
  },
  components: {
    MyUser,
    MyCheck,
    MyApply,
    MyCost
  },
  computed: {
    ...mapState(["op4"])
  },
  mounted() {

  },
  methods: {},
  watch: {},
  destroyed() {

  },
}
</script>

<style scoped>
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/*动画*/
.m-enter,
.m-leave-to {
  opacity: 0;
}
.m-enter-active,
.m-leave-active {
  transition: all 0.4s;
}
/*盗汗蓝*/
.box-nave{
  margin: 20px 0;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 25px;
  letter-spacing: 4px;
}
.page{
  color: #909399;
  height: 100%;
  line-height: 50px;
  box-sizing: border-box;
  transition: all .5s;
  border-bottom: 2px solid #ffffff;
  cursor: pointer;
  margin: 0 20px;
}
.bb{
  color: #000000;
  border-bottom: 2px solid #000000;
}


/**/

/*主题*/
.box-main {
  width: 93%;
  min-height: 400px;
  margin-top: 50px;
}


/**/
/*头部*/
.box-header {
  width: 100%;
  height: 120px;
  position: relative;
  background-color: pink;
}

.user-tou {
  position: absolute;
  bottom: -50px;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, 0);
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 50%;
  box-sizing: border-box;
  background-color: #ffffff;
}

.image {
  width: 100%;
  height: 100%;
}

/**/
</style>
